import request from "@/utils/request";
import qs from 'qs'

export function treeList() {
  return request.get(`/department/treeList`)
}

export function listData(params) {
  return request.get(`/department/list`, {params})
  // return request.get(`/v1/department/list`, {params})
  //添加了v1后去vue.config.js代理修改成v1
}

export function saveOrUpdate(params) {
  return request.post(`/department/saveOrUpdate`, params);
}

export function deleteById(id) {
  return request.post(`/department/delete`, qs.stringify({id}), {
    method: 'POST',
    headers: {'content-type': 'application/x-www-form-urlencoded'}
  });
}

export function listAll() {
    return request.get('/department/listAll')
}
